#!/bin/sh
# - cur_state
# - max_state

. $LKP_SRC/lib/reproduce-log.sh

if [ "${0#*intel_powerclamp}" != "$0" ]; then
	type='intel_powerclamp'
else
	type='Processor'
fi

for i in /sys/class/thermal/cooling_device*
do
	[ -f "$i/type" ] || continue
	[ "$(cat $i/type)" = "$type" ] || continue

	[ -n "$cur_state" ] && {
		log_eval "echo ${cur_state%cp} > $i/cur_state"
	}

	[ -n "$max_state" ] && {
		log_eval "echo ${max_state%mp} > $i/max_state"
	}
done
